package com.iims.common.core.page;

import cn.hutool.core.lang.Validator;
import com.iims.common.core.domain.HttpParamMap;
import com.iims.common.utils.ServletUtils;

/**
 * @author fanpei
 * @date 2021/6/9 9:34
 */
public class SearchTimeSupport {

    /**
     * 当前记录起始索引
     */
    public static final String START_TIME = "beginTime";

    /**
     * 每页显示记录数
     */
    public static final String END_TIME = "endTime";

    public static void setSearchTimeRange(HttpParamMap paramMap) {
        String begintime = ServletUtils.getParameter(START_TIME);
        String endtime = ServletUtils.getParameter(END_TIME);
        if (Validator.isNotEmpty(begintime) && Validator.isNotEmpty(endtime)) {
            paramMap.put(START_TIME, begintime);
            paramMap.put(END_TIME, endtime);
        }
    }
}
